package com.xuecheng;



import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xuecheng.model.PageParams;
import com.xuecheng.model.PageResult;
import com.xuecheng.content.mapper.CourseBaseMapper;
import com.xuecheng.content.model.dto.QueryCourseParamsDto;
import com.xuecheng.content.service.iml.CourseBaseServiceIml;
import com.xuecheng.content.model.po.CourseBase;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Objects;

@SpringBootTest
class CourseBaseMapperTests {

    @Autowired
    private CourseBaseMapper courseBaseMapper;

    @Autowired
    private CourseBaseServiceIml courseBaseServiceIml;
    @Test
    void testCourseBaseMapper() {
        CourseBase courseBase = courseBaseMapper.selectById(74L);
        if(!Objects.isNull(courseBase)){
            System.out.println(""+courseBase.toString());
        }
        //分页查询

        LambdaQueryWrapper<CourseBase> wrapper = new LambdaQueryWrapper<>();

        Page<CourseBase> page = new Page<>(1L,20L);
        Page<CourseBase> courseBasePage = courseBaseMapper.selectPage(page, wrapper);

        System.out.println(JSONObject.toJSON(courseBasePage));
    }

    @Test
    void testCourseBaseInfoService() {

    }

}